<script setup lang="ts">
import { useCounterStore } from '@/stores/counter';

const store=useCounterStore()
</script>

<template>
  <div id="app">
    <div class="link">
      <router-link to="/home">首页</router-link>
      <router-link to="/search">搜索页</router-link>
      <router-link to="/my">我的</router-link>
      <span>{{ store.count }}</span>
      <button @click="store.increment()">累加</button>
    </div>
    <router-view></router-view>
  </div>
</template>

<style scoped>
.link {
  height: 50px;
  line-height: 50px;
  background-color: #495150;
  display: flex;
  margin: -8px -8px 0 -8px;
  margin-bottom: 50px;
}

.link a {
  display: block;
  text-decoration: none;
  background-color: #ad2a26;
  width: 100px;
  text-align: center;
  margin-right: 5px;
  color: #fff;
  border-radius: 5px;
}
</style>